import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import commonJs from "@/tool/common";
import api from "./api/apiConfig";
import ajax from "./api/http";
import VeeValidate, { Validator } from "vee-validate";
import zh_CN from "vee-validate/dist/locale/zh_CN";
import $crypto from "@/tool/crypto";
import VueI18n from "vue-i18n";
import {
  Button,
  Icon,
  LocaleProvider,
  Tag,
  Collapse,
  Form,
  Input,
  Divider,
  Checkbox,
  Modal,
  message
} from "ant-design-vue";
import "@/styles/theam.less";
import "@/styles/common.less";
import "@/styles/reset.css";
Vue.use(Icon);
Vue.use(Modal);
Vue.use(Button);
Vue.use(LocaleProvider);
Vue.use(Tag);
Vue.use(Collapse);
Vue.use(Form);
Vue.use(Input);
Vue.use(Divider);
Vue.use(Checkbox);
Vue.prototype.$message = message;
Vue.prototype.$commonJs = commonJs;
Vue.prototype.$crypto = $crypto;
Vue.prototype.$api = api;
Vue.prototype.$ajax = ajax;

Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: "zh_CN"
});
const dict = {
  zh_CN: {
    messages: {
      required: name => `请输入${name}`,
      is: () => "两次输入的密码不一致"
    }
  } // name接受alias的值.
};
Vue.config.productionTip = false;
Vue.use(VeeValidate, {
  i18n,
  i18nRootKey: "validation",
  dictionary: {
    zh_CN
  }
});
Validator.localize(dict);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
